<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../Templates/InnerSystemTemplate.xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">
    
    <ui:define name="head_title">
        <title>Edit Profile | Merlion's ERP System</title>
    </ui:define>
    
    <ui:define name="content">
        <f:view beforePhase="#{editProfileManagerBean.initView}">
        <h:form prependId="false">  
                
            <p:panel id="panel" header="Edit Profile"> 
                <p:ajaxStatus style="width:16px;height:16px;">   
                    <f:facet name="start">   
                        <p:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" /> 
                    </f:facet> 
 
                    <f:facet name="complete">   
                        <h:outputText value="" />   
                    </f:facet>   
                </p:ajaxStatus> 
 
                <p:messages /> 
 
                <h:panelGrid columns="3" cellpadding="10"> 
                    
                    <h:outputLabel for="employeeUserName" style="font-weight: bold" value="Username: " /> 
                    <h:outputLabel value="#{editProfileManagerBean.employeeToEdit.userName}" id="employeeUserName"/>                    
                    <br/>
                    
                    <h:outputLabel for="employeeName" style="font-weight: bold" value="Name: " /> 
                    <h:outputLabel value="#{editProfileManagerBean.employeeToEdit.employeeName}" id="employeeName"/>
                    <br/>
                    
                    <h:outputLabel for="employeeNRIC" style="font-weight: bold" value="NRIC: " /> 
                    <h:outputLabel value="#{editProfileManagerBean.employeeToEdit.employeeNRIC}" id="employeeNRIC"/>
                    <br/>
                    
                    <h:outputLabel for="employeeAddress" style="font-weight: bold" value="Address: " /> 
                    <p:inputText value="#{editProfileManagerBean.employeeToEdit.employeeAddress}" required="true" label="Employee Address" requiredMessage="Employee's address is required." id="employeeAddress">
                    </p:inputText> 
                    <p:message for="employeeAddress" /> 
                    
                    <h:outputLabel for="employeeEmail" style="font-weight: bold" value="Email: " /> 
                    <p:inputText value="#{editProfileManagerBean.employeeToEdit.employeeEmail}" required="true" label="Employee Email" requiredMessage="Employee's email is required." id="employeeEmail">
                    </p:inputText> 
                    <p:message for="employeeEmail" /> 
                    
                    <h:outputLabel for="employeeContactNo" style="font-weight: bold" value="Contact Number: " /> 
                    <p:inputText value="#{editProfileManagerBean.employeeToEdit.employeeContactNumber}" required="true" label="Employee Contact" requiredMessage="Employee's contact number is required." id="employeeContactNo">
                    </p:inputText> 
                    <p:message for="employeeContactNo" /> 
                </h:panelGrid>                
                <p:commandButton id="btn" value="Update" update="panel" actionListener="#{editProfileManagerBean.updateExistingEmployee(event)}" ajax="true" />
            </p:panel> 

        </h:form>
        </f:view>
    </ui:define>

</ui:composition>
